/**
 * 
 */
package com.curso.sesion8.constructores;

/**
 * @author MATEUS
 *
 */
public class Son extends Father {

	private int age;
	private char gender;
	
	private static Byte unResponsabilityLevel;
	
	static {
		System.out.println("bloque de inicializacion estatico en Son");
		
		if (unResponsabilityLevel == null) {
			unResponsabilityLevel = 1;
		}
	}
	
	
	{
		System.out.println("bloque de inicializacion en Son");
		if (name == null) {
			name = "default name Son";
		}
	}
	
	/**
	 * 
	 */
	public Son() {
		super();
		System.out.println("constructor del son");
	}
	
	/**
	 * @param age
	 * @param gender
	 * @param name
	 */
	public Son(int age, char gender, String name) {
		this();
		System.out.println("constructor 2 del son");
		this.age = age;
		this.gender = gender;
		this.name = name;
	}
	
	public Son(int age, String name, boolean isWoman) {
		this(age, isWoman ? 'F': 'M', name);
		System.out.println("constructor 3 del son");
		this.age = age;
		this.name = name;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Son [age=" + age + ", gender=" + gender + ", "
				+ (name != null ? "name=" + name : "") + "]";
	}

}
